package com.qk.controller;

import com.qk.commen.PageResult;
import com.qk.commen.Result;
import com.qk.dto.LogDto;
import com.qk.entity.OperateLog;
import com.qk.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/logs")
public class OperateLogController {

    @Autowired
    private OperateLogService operateLogService;

    /**
     * 日志查询
     */
    @GetMapping
    public Result log(LogDto logDto){
        log.info("日志查询");
        PageResult<OperateLog> operateLogPageResult = operateLogService.logList(logDto);

        return Result.success(operateLogPageResult);
    }
}
